
<%@page import="com.sun.faces.facelets.tag.jstl.core.ForEachHandler"%>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@page import="java.sql.*" %>
<%@page import="Exam.Shujulj" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
       <base href="<%=basePath%>">
    
    <title>My JSP 'index.jsp' starting page</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<%
	request.setCharacterEncoding("utf-8");
	response.setContentType("text/html;charset=utf-8");
	 %>
  </head>
  
  <body>
  
<%
String xm=request.getParameter("xm");
String xb=request.getParameter("xb");
String[] str=request.getParameterValues("lou");

for(String kl :str){
Connection con=Shujulj.getConnection();
Statement stat=con.createStatement();
String sql="insert into cf values('"+kl+"')";
stat.executeUpdate(sql);
}
Connection con=Shujulj.getConnection();
Statement stat=con.createStatement();
stat.executeUpdate(String.format("insert into df(xm,xb) values('%s','%s');",xm,xb));

response.sendRedirect("index.jsp"); 


 %>
  </body>
</html>
